import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/mining_user_statistics_entity.dart';

MiningUserStatisticsEntity $MiningUserStatisticsEntityFromJson(
    Map<String, dynamic> json) {
  final MiningUserStatisticsEntity miningUserStatisticsEntity = MiningUserStatisticsEntity();
  final String? inputStone = jsonConvert.convert<String>(json['inputStone']);
  if (inputStone != null) {
    miningUserStatisticsEntity.inputStone = inputStone;
  }
  final String? outputStone = jsonConvert.convert<String>(json['outputStone']);
  if (outputStone != null) {
    miningUserStatisticsEntity.outputStone = outputStone;
  }
  final String? yesterdayOutputStone = jsonConvert.convert<String>(
      json['yesterdayOutputStone']);
  if (yesterdayOutputStone != null) {
    miningUserStatisticsEntity.yesterdayOutputStone = yesterdayOutputStone;
  }
  final String? waitOutputStone = jsonConvert.convert<String>(
      json['waitOutputStone']);
  if (waitOutputStone != null) {
    miningUserStatisticsEntity.waitOutputStone = waitOutputStone;
  }
  final String? updatedAt = jsonConvert.convert<String>(json['updatedAt']);
  if (updatedAt != null) {
    miningUserStatisticsEntity.updatedAt = updatedAt;
  }
  final String? stoneNum = jsonConvert.convert<String>(json['stoneNum']);
  if (stoneNum != null) {
    miningUserStatisticsEntity.stoneNum = stoneNum;
  }
  return miningUserStatisticsEntity;
}

Map<String, dynamic> $MiningUserStatisticsEntityToJson(
    MiningUserStatisticsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['inputStone'] = entity.inputStone;
  data['outputStone'] = entity.outputStone;
  data['yesterdayOutputStone'] = entity.yesterdayOutputStone;
  data['waitOutputStone'] = entity.waitOutputStone;
  data['updatedAt'] = entity.updatedAt;
  data['stoneNum'] = entity.stoneNum;
  return data;
}

extension MiningUserStatisticsEntityExt on MiningUserStatisticsEntity {
  MiningUserStatisticsEntity copyWith({
    String? inputStone,
    String? outputStone,
    String? yesterdayOutputStone,
    String? waitOutputStone,
    String? updatedAt,
    String? stoneNum,
  }) {
    return MiningUserStatisticsEntity()
      ..inputStone = inputStone ?? this.inputStone
      ..outputStone = outputStone ?? this.outputStone
      ..yesterdayOutputStone = yesterdayOutputStone ?? this.yesterdayOutputStone
      ..waitOutputStone = waitOutputStone ?? this.waitOutputStone
      ..updatedAt = updatedAt ?? this.updatedAt
      ..stoneNum = stoneNum ?? this.stoneNum;
  }
}